<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="Format" content="text/html" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<meta name="Robots" content="index,follow" />
<meta name="Charset" content="utf-8" />
<meta name="Author" content="master@newstools.kr" />
<meta name="Generator" content="EditPlus Text Editor v3.31" />
<title>사건접수2</title>
<link rel="stylesheet" href="skin/css/common.css" type="text/css" />
<link rel="stylesheet" href="skin/css/accident2.css" type="text/css" />
<script language="javascript" type="text/javascript" src="skin/js/jquery-1.7.1.min.js" ></script>
<script language="javascript" type="text/javascript" src="skin/js/common_interface.js" ></script>
</head>
<body>
	<script type="text/javascript">
	//<![CDATA[
		function readWebData() {
			//사고유형#피해자명1#피해자연락처1#피해자명2#피해자연락처2#차량번호1#차량연락처1#차량번호2#차종#차량연락처2
			var form = document.getElementById('contForm');
			var rtn = '';
			var validation = false;

			//사고유형 입력값 체크
			var inputs = document.getElementsByName('accident_case');
			for (var i=0; i < inputs.length; i++) {
				if( inputs[i].checked ) {
					rtn = inputs[i].value;
					validation = true;
				}
			}
			if ( !validation ) {
				alert("사고유형을 선택해주세요");
				return '';
			}

			//피해종류 입력값 체크
			validation = false;	//플래그 재설정
			for (var i=0; i < 4; i++) {
				if( $('#effect'+i).attr('checked')=='checked' ) {
					if( $('#effect'+i+'_name').IsEmptyData() ) {
						alert("피해종류의 입력값을 빠짐없이 입력하여 주세요");
						return '';
					}
					else {
						rtn = MergeData(rtn, $('#effect'+i+'_name').attr('value'));
					}

					if( $('#effect'+i+'_number').IsEmptyData() ) {
						alert("피해종류의 입력값을 빠짐없이 입력하여 주세요");
						return '';
					}
					else {
						rtn = MergeData(rtn, $('#effect'+i+'_number').attr('value'));
					}

					if( i == 3 ){
						if( $('#effect'+i+'_number2').IsEmptyData() ) {
							alert("피해종류의 입력값을 빠짐없이 입력하여 주세요");
							return '';
						}
						else {
							rtn = MergeData(rtn, $('#effect'+i+'_number2').attr('value'));
						}
					}
					validation = true;
				}
				else {
					rtn = MergeData(rtn, '');
					rtn = MergeData(rtn, '');
					if( i == 3 ) rtn = MergeData(rtn, '');
				}
			}
			if ( !validation ) {
				alert("피해종류는 반드시 하나는 입력해 주세요");
				return '';
			}

			return rtn;
		}

		function WmWriteMsg(arg) {
			//사고유형#피해자명1#피해자연락처1#피해자명2#피해자연락처2#차량번호1#차량연락처1#차량번호2#차종#차량연락처2
			var arryData = new Array();
			arryData = SplitData(arg);

			var form = document.getElementById('contForm');

			//사고유형 입력값 설정
			var inputs = document.getElementsByName('accident_case');
			for (var i=0; i < inputs.length; i++) {
				if( inputs[i].value==arryData[0] ) {
					$(inputs[i]).parent().children('img.rad').ImageStateChanger(true,'_on.','_off.');
					inputs[i].checked = 'checked';
				}
				else {
					$(inputs[i]).parent().children('img.rad').ImageStateChanger(false,'_on.','_off.');
					inputs[i].checked = null;
				}
			}

			//피해종류 입력값 설정
			for (var i=0; i < 3; i++) {	//3가지만 패턴이 동일하므로
				if ( (arryData[i*2 + 1]!='') || (arryData[i*2 + 2]!='') ) {
					$('#effect'+i).attr('checked','checked');
					$('#effect'+i).parent().children('img.chk').ImageStateChanger(true,'_on.','_off.');
					$('#effect'+i).siblings('.writebox').removeClass('blind');
				}
				else {
					$('#effect'+i).attr('checked',null);
					$('#effect'+i).parent().children('img.chk').ImageStateChanger(false,'_on.','_off.');
					$('#effect'+i).siblings('.writebox').addClass('blind');
				}
				$('#effect'+i+'_name').attr('value',arryData[i*2 + 1]);
				$('#effect'+i+'_number').attr('value',arryData[i*2 + 2]);
			}

			//입력패턴이 다른 마지막 경우만 따로 구현하였음
			if ( (arryData[7]!='') || (arryData[8]!='') || (arryData[9]!='') ) {
				$('#effect3').attr('checked','checked');
				$('#effect3').parent().children('img.chk').ImageStateChanger(true,'_on.','_off.');
				$('#effect3').siblings('.writebox').removeClass('blind');
				$('#effect3').parent().css('margin-bottom','0');
			}
			else {
				$('#effect3').attr('checked',null);
				$('#effect3').parent().children('img.chk').ImageStateChanger(false,'_on.','_off.');
				$('#effect3').siblings('.writebox').addClass('blind');
				$('#effect3').parent().css('margin-bottom','2%');
			}
			$('#effect3_name').attr('value',arryData[7]);
			$('#effect3_number').attr('value',arryData[8]);
			$('#effect3_number2').attr('value',arryData[9]);
		}

		//사고유형 라디오버튼 선택효과 처리
		function choiceCase(obj) {
			var inputs = document.getElementsByName($(obj).parent().children('input').attr('name'));

			//모든 라디오버튼 off상태로 변경
			for (var i=0; i < inputs.length; i++) {
				if( inputs[i].checked ) {
					$(inputs[i]).attr('checked','');
					$(inputs[i]).parent().children('img.rad').ImageStateChanger(false,'_on.','_off.');
				}
			}
			//해당 버튼 on상태로 변경
			$(obj).parent().children('input').attr('checked','checked');
			$(obj).ImageStateChanger(true,'_on.','_off.');
		}

		//피해종류 선택버튼 교체효과 처리 : 라디오 버튼처럼 그룹화된 기능 추가적용
		function choiceEffect(obj) {
			if( $(obj).parent().children('input').attr('checked')=='checked' )
			{
				$(obj).parent().children('input').attr('checked',null);
				if( $(obj).parent().attr('id')=='que4' ){	$(obj).parent().css('margin-bottom','2%');	}
				$(obj).css('top','12%');
				$(obj).ImageStateChanger(false,'_on.','_off.');
			}
			else
			{
				//피해종류에 대한 체크박스 상태점검
				$('.inputbox2 input').each(function () {
					//자신을 제외한 체크박스 상태점검
					if( $(this).attr('id')!==$(obj).parent().children('input').attr('id') ) {
						//선택되어 있는 체크박스인 경우 닫음
						if( $(this).attr('checked')=='checked' ) {
							$(this).attr('checked',null);
							if( $(this).parent().attr('id')=='que4' ){	$(this).parent().css('margin-bottom','2%');	}
							$(this).siblings('.chk').css('top','12%');
							$(this).siblings('.chk').ImageStateChanger(false,'_on.','_off.');
							$(this).siblings('.writebox').toggleClass('blind');
						}
					}
				});

				$(obj).parent().children('input').attr('checked','checked');
				if( $(obj).parent().attr('id')=='que4' ){	$(obj).parent().css('margin-bottom','0');	}
				$(obj).css('top','6%');
				$(obj).ImageStateChanger(true,'_on.','_off.');
			}
			$(obj).siblings('.writebox').toggleClass('blind');
		}

		/* STR : onfocus 효과 선언 */
		(function ($) {
			$(document).ready(function () {
				$('#effect0_name, #effect0_number, #effect1_name, #effect1_number, #effect2_name, #effect2_number, #effect3_name, #effect3_number, #effect3_number2').bind({
					focusin: function () {
						if( $(this).data('org-background-image')===undefined )
							$(this).data('org-background-image', $(this).css('background-image'));

						if( $(this).hasClass('obname') ) {
							$(this).css('background-image', 'url("../images/bg_input_obname.jpg")');
						}
						else if( $(this).hasClass('obnumber') ) {
							$(this).css('background-image', 'url("../images/bg_input_obnumber.jpg")');
						}
						else if( $(this).hasClass('obnumber2') ) {
							$(this).css('background-image', 'url("../images/bg_input_obnumber2.jpg")');
						}
					}
				});
			});
		})(jQuery);
		/* END : onfocus 효과 선언 */
	//]]>
	</script>
	<div id="wrapper">
		<form id="contForm">
		<!-- STR : content -->
		<div id="content">
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td id="content_top_left"></td>
					<td id="content_top_center"></td>
					<td id="content_top_right"></td>
				</tr>
				<tr>
					<td id="content_middle_left"></td>
					<!-- STR : 콘텐트 노출 박스 중앙 출력부 -->
					<td id="content_display">
						<!-- 타이틀 출력부 -->
						<h1><img src="skin/images/title_accident_2.jpg" title="사고접수(2단계)" /></h1>

						<!-- 제목이미지 : 피해종류 -->
						<h2 class="tit_case"><img src="skin/images/title_accident_case.jpg" title="사고유형" /></h2>

						<!-- STR : 사고유형 -->
						<div class="inputbox">
							<img class="rad" src="skin/images/bg_accident_case_off.jpg" onclick="choiceCase(this);" />
							<input type="radio" name="accident_case" value="차대차" />
							<img src="skin/images/img_accident_case_01.jpg" title="차대차" />
						</div>

						<div class="inputbox">
							<img class="rad" src="skin/images/bg_accident_case_off.jpg" onclick="choiceCase(this);" />
							<input type="radio" name="accident_case" value="차대인" />
							<img src="skin/images/img_accident_case_02.jpg" title="차대인" />
						</div>

						<div class="inputbox">
							<img class="rad" src="skin/images/bg_accident_case_off.jpg" onclick="choiceCase(this);" />
							<input type="radio" name="accident_case" value="자차단독" />
							<img src="skin/images/img_accident_case_03.jpg" title="자차단독" />
						</div>

						<div class="inputbox">
							<img class="rad" src="skin/images/bg_accident_case_off.jpg" onclick="choiceCase(this);" />
							<input type="radio" name="accident_case" value="그외유형" />
							<img src="skin/images/img_accident_case_04.jpg" title="그외유형" />
						</div>
						<!-- END : 사고유형 -->

						<!-- 제목이미지 : 피해종류 -->
						<h2 class="tit_effect"><img src="skin/images/title_accident_effect.jpg" title="피해종류 * 적어도 1개 의 담보는 필수 선택" /></h2>

						<!-- STR : 피해종류 -->
						<div class="inputbox2">
							<img src="title_accident_effect_01.jpg" title="고객님 및 가족 중 다치신 분이 있습니까?" />
							<img class="chk" src="btn_accident_effect_off.jpg" onclick="choiceEffect(this);" />
							<input type="checkbox" class="blind" name="effect0" id="effect0" />

							<!-- 피해종류 입력영역 -->
							<div class="writebox blind">
								<div class="writeleft">
									<input type="text" class="obname" id="effect0_name" name="effect0_name" style="background-image:url('../images/bg_input_obname_name.jpg');" />
								</div>
								<div class="writeright">
									<input type="tel" class="obnumber" id="effect0_number" name="effect0_number" style="background-image:url('../images/bg_input_obnumber_phone.jpg');" />
								</div>
								<div class="writebottom"></div>
							</div>
						</div>

						<div class="inputbox2">
							<img src="title_accident_effect_02.jpg" title="고객님 및 가족 외 다치신 분이 있습니까?" />
							<img class="chk" src="btn_accident_effect_off.jpg" onclick="choiceEffect(this);" />
							<input type="checkbox" class="blind" name="effect1" id="effect1" />

							<!-- 피해종류 입력영역 -->
							<div class="writebox blind">
								<div class="writeleft">
									<input type="text" class="obname" id="effect1_name" name="effect1_name" style="background-image:url('../images/bg_input_obname_name.jpg');" />
								</div>
								<div class="writeright">
									<input type="tel" class="obnumber" id="effect1_number" name="effect1_number" style="background-image:url('../images/bg_input_obnumber_phone.jpg');" />
								</div>
								<div class="writebottom"></div>
							</div>
						</div>

						<div class="inputbox2">
							<img src="title_accident_effect_03.jpg" title="고객님 차량에 파손이 있습니까?" />
							<img class="chk" src="btn_accident_effect_off.jpg" onclick="choiceEffect(this);" />
							<input type="checkbox" class="blind" name="effect2" id="effect2" />

							<!-- 피해종류 입력영역 -->
							<div class="writebox blind">
								<div class="writeleft">
									<input type="text" class="obname" id="effect2_name" name="effect2_name" style="background-image:url('../images/bg_input_obname_carnum.jpg');" />
								</div>
								<div class="writeright">
									<input type="tel" class="obnumber" id="effect2_number" name="effect2_number" style="background-image:url('../images/bg_input_obnumber_phone.jpg');" />
								</div>
								<div class="writebottom"></div>
							</div>
						</div>

						<div id="que4" class="inputbox2">
							<img src="title_accident_effect_04.jpg" title="고객님 차량외에 파손된 차량(물건)이 있습니까?" />
							<img class="chk" src="btn_accident_effect_off.jpg" onclick="choiceEffect(this);" />
							<input type="checkbox" class="blind" name="effect3" id="effect3" />

							<!-- 피해종류 입력영역 -->
							<div id="wrt4" class="writebox blind">
								<div class="writeleft">
									<input type="text" class="obname" id="effect3_name" name="effect3_name" style="background-image:url('../images/bg_input_obname_carnum.jpg');" />
								</div>
								<div class="writeright">
									<input type="text" class="obnumber" id="effect3_number" name="effect3_number" style="background-image:url('../images/bg_input_obnumber_carname_s.jpg');" />
								</div>
								<div class="writebottom">
									<input type="tel" class="obnumber2" id="effect3_number2" name="effect3_number2" style="background-image:url('../images/bg_input_obnumber2_phone.jpg');" />
								</div>
							</div>
						</div>
						<!-- END : 피해종류 -->
					</td>
					<!-- END : 콘텐트 노출 박스 중앙 출력부 -->
					<td id="content_middle_right"></td>
				</tr>
				<tr>
					<td id="content_bottom_left"></td>
					<td id="content_bottom_center"></td>
					<td id="content_bottom_right"></td>
				</tr>
			</table>
		</div>
		<!-- END : content -->
		</form>
	</div>
</body>
</html>